<style>
#header h1 a {
z-index: 9999;
display: block;
}
</style>
<div id="header">
	<h1><a href="<?php echo base_url();?>" title="Xem trang chủ">Admin CP</a></h1>	
	<a id="menu-trigger" href="#"><i class="glyphicon glyphicon-align-justify"></i></a>	
</div>

<div id="user-nav">
	<ul class="btn-group">
		<li class="btn" ><a title="" href="#"><i class="glyphicon glyphicon-user"></i> <span class="text">Profile</span></a></li>
		<?php /*
		<li class="btn dropdown" id="menu-messages"><a href="#" data-toggle="dropdown" data-target="#menu-messages" class="dropdown-toggle"><i class="glyphicon glyphicon-envelope"></i> <span class="text">Messages</span> <span class="label label-danger">5</span> <b class="caret"></b></a>
			<ul class="dropdown-menu">
				<li><a class="sAdd" title="" href="#">new message</a></li>
				<li><a class="sInbox" title="" href="#">inbox</a></li>
				<li><a class="sOutbox" title="" href="#">outbox</a></li>
				<li><a class="sTrash" title="" href="#">trash</a></li>
			</ul>
		</li> */?>
		<li class="btn"><a title="" href="#"><i class="glyphicon glyphicon-cog"></i> <span class="text">Settings</span></a></li>
		<li class="btn"><a title="" href="<?php echo admin_url();?>logout.html"><i class="glyphicon glyphicon-share-alt"></i> <span class="text">Logout</span></a></li>
	</ul>
</div>
<div id="sidebar">
	<!--<a href="#" class="hide"><i class="glyphicon glyphicon-home"></i> Dashboard</a>--> 
	 <ul><?php //print_r(admin_url());?>
		<li <?php echo (current_url() == base_url()."admin.html")?'class="active"':'';?>><a href="<?php echo admin_url();?>"><i class="glyphicon glyphicon-home"></i> <span>Dashboard</span></a></li>
		
		
		<?php
		$resources = $this->permission->get_resData($this->madmin->adm_id); 
		$arr_resources = array();
		 foreach($resources as $resource){
			$arr_resources[$resource->RESG_ID][] =  $resource;
		 }
		 
		 if($arr_resources){
			$resource_group = $this->mresourcegroups->where_in(array_keys($arr_resources),'RESG_ID');
		 }
		 if(isset($resource_group))
		 foreach($resource_group as $group){
		?>
		<li class="submenu <?php echo (@$this->ci->resource->RESG_ID == $group->RESG_ID)?'active open':'';?>" >
			<a href="#"><i class="glyphicon <?php echo $group->RESG_THUMBPATH;?>"></i> <span><?php echo $group->RESG_NAME;?></span></a>
			<ul><?php foreach($arr_resources[$group->RESG_ID] as $r) { ?>
				<li <?php echo (@$this->ci->resource->RES_CODE == $r->RES_CODE)?'class="active"':'';?>><a href="<?php echo admin_url(); ?><?php echo $r->RES_LINK;?>.html">
				<i class="glyphicon <?php echo $r->RES_ICON;?>"></i> <?php echo $r->RES_NAME;?></a></li>
				<?php } ?>
			</ul>
		</li>
	<?php }?>
	<?php 
	if(isset($arr_resources[0]))
	foreach($arr_resources[0] as $resource){?>
	<li <?php echo (@$this->ci->resource->RES_CODE == $resource->RES_CODE)?'class="active"':'';?>><a href="<?php echo admin_url(); ?><?php echo $resource->RES_LINK;?>.html"><i class="glyphicon <?php echo $resource->RES_ICON;?>"></i> <span><?php echo $resource->RES_NAME;?></span></a></li>
	
	<?php }?>
	</ul>

</div>
<!--
<div id="style-switcher">
	<i class="glyphicon glyphicon-arrow-left"></i>
	<span>Style:</span>
	<a href="#grey" style="background-color: #555555;border-color: #aaaaaa;"></a>
	<a href="#light-blue" style="background-color: #8399b0;"></a>
	<a href="#blue" style="background-color: #2D2F57;"></a>
	<a href="#red" style="background-color: #673232;"></a>
	<a href="#red-green" style="background-image: url('img/demo/red-green.png');background-repeat: no-repeat;"></a>
</div> -->
<div id="content">
	<div id="content-header">
		<h1><?php echo @$this->ci->resource->RES_NAME; ?> &nbsp;</h1>
		
	</div>
	<div id="breadcrumb">
		<a href="<?php echo admin_url(); ?>" title="Go to Home" class="tip-bottom"><i class="glyphicon glyphicon-home"></i> Home</a>
		<a href="<?php echo @$this->ci->url_index; ?>"  title="<?php echo @$this->ci->resource->RES_NAME; ?>" class="tip-bottom" class="current"><?php echo @$this->ci->resource->RES_NAME; ?> </a>
	</div>
